<template>
    <div>
        <h1>我的收藏</h1> 
        <van-row type="flex" justify="space-around" class="list-container">
            <van-col span="10" v-for="item in list" :key="item.id" class="list-content" @click="goDetail(item.id)">
                <img :src="item.list_pic_url" alt="" class="list-img">
                <p>{{item.name}}</p>
                <p>{{item.retail_price}}起</p>
            </van-col>
        </van-row>
    </div>
</template>

<script>
import {collect} from "@/axios/index"
export default {
    name: 'collection',

    data() {
        return {
            list:[]
        };
    },
    async created(){
        let res = await collect({openId:localStorage.getItem("openId")})
        // console.log(res.collectGoodsList);
        this.list=res.collectGoodsList;
    },
    mounted() {
        
    },

    methods: {
        goDetail(id){
            this.$router.push({name:"categoryDetail",params:{"id":id}})
        }
    },
};
</script>

<style scoped lang="scss">
.list-container{
    .list-content{
        .list-img{
            width: 40%;
        }
    }
}
</style>e